package com.example.configclinet;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * Config Client Test Controller
 *
 * @author CD826(CD826Dong@gmail.com)
 * @since 1.0.0
 */

@RestController
public class ConfigController {
    @Value("${spring.datasource.url}")
    String dbHost;

    @Value("${spring.datasource.username}")
    String dbUsername;

    @Value("${spring.datasource.password}")
    String dbPassword;

    @RequestMapping(value = "/cfg")
    public Object foo(){
        HashMap<String, String> hashMap= new HashMap();
        hashMap.put("dbHost", dbHost);
        hashMap.put("dbUsername", dbUsername);
        hashMap.put("dbPassword", dbPassword);
        return hashMap;
    }
}